<template>
  <div>
    <h1>Hi Vue3</h1>
    <FileList :datas="datas"></FileList>
  </div>
</template>

<script setup lang="ts">
import FileList from "./FileList.vue";
interface File {
  filename: string;
  size: number;
  type: number;
}
interface Dir {
  dirname: string;
  content: BaseType[];
  type: number;
  expend: boolean;
}

type BaseType = File | Dir;
const datas: BaseType[] = [
  {
    dirname: "a",
    content: [
      {
        filename: "2.txt",
        size: 100,
        type: 1,
      },
      {
        dirname: "b",
        type: 0,
        content: [
          {
            filename: '4.txt',
            size: 100,
            type: 1,
          }
        ],
        expend: true
      },
      {
        filename: "3.txt",
        size: 100,
        type: 1,
      },
    ],
    type: 0,
    expend: false,
  },
  {
    filename: "1.txt",
    size: 100,
    type: 1,
  },
];
</script>

<style scoped lang="less">
.icon {
  width: 200px;
  height: 200px;
}
</style>
